<template>
  <div>
    <input type="text" v-model="serach">
    <button @click="searcHandle">搜索</button>
    <ul v-for="( item,index) in seracDmin" :key="index">
      <li> {{item.name}}</li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'Search',
  data () {
    return {
      // 定义搜索的字段
      serach: '',
      seracDmin: []
    }
  },
  methods: {
    searcHandle () {
      this.$api.getSearch({
        keywords: this.serach
      }).then(res => {
        console.log(res)
        this.seracDmin = res.result.songs
      })
    }
  }

}
</script>

<style>

</style>
